﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using CWB.Web.DB;
using CWB.Web.Models;

namespace CWB.WebSite.Models.Agent
{
    //Agent listing.
    [DataContract]
    public class AgentViewModel : DataModel<AgentListingModel>
    {
        [DataMember(Name = "cpo")]
        public int CurrentPosition { get; set; }
    }


    [DataContract]
    public class AgentListingModel
    {
        [DataMember(Name = "sn")]
        public int sn;
        [DataMember(Name = "posi")]
        public Position position;
        //[DataMember(Name = "poss")]
        public int possess;
        //[DataMember(Name = "n")]
        public string Notes;
        [DataMember(Name = "u")]
        public string Username;
        [DataMember(Name = "l")]
        public string Loginid;
        //[DataMember(Name = "climit")]
        public decimal CreditLimit;
        [DataMember(Name = "s")]
        public Status status;

        public class Position : IdName { }
        public class Status : IdName { }
    }

    //Agent update
    [DataContract]
    public class AgentUpdateModel : ViewModelBase
    {
        public DbModuleAgent Agent;
        public int PossessRange;
        public string parentLoginid;
        public List<string> DownLineList;
        public List<AgentUpdateProdItemModel> ProdItems;
    }

    public class AgentUpdateProdItemModel : DbModuleProd
    {
        public int price;
    }
}
